package od_2024E;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;
import java.util.StringJoiner;

/**
 * file:///C:/Users/Lsz/Desktop/%E5%8D%8E%E4%B8%BAOD%E7%AC%94%E8%AF%95%E5%AE%9D%E5%85%B8/%E5%AE%9D%E5%85%B8/(E%E5%8D%B7,100%E5%88%86)%20-%20%E6%9F%A5%E6%89%BE%E6%8E%A5%E5%8F%A3%E6%88%90%E5%8A%9F%E7%8E%87%E6%9C%80%E4%BC%98%E6%97%B6%E9%97%B4%E6%AE%B5%EF%BC%88Java%20&%20Python&%20JS%20&%20C++%20&%20C%20%EF%BC%89.html
 */
public class Test02 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        // 容忍的平均失败率
        int toleratedAverageLoss = Integer.parseInt(scanner.nextLine());

        // 读取失败率数组
        Integer[] failureRates =
                Arrays.stream(scanner.nextLine().split(" ")).map(Integer::parseInt).toArray(Integer[]::new);

        int arrayLength = failureRates.length;

        // 创建一个累积和数组，用于快速计算任意时间段的失败率总和
        int[] cumulativeSum = new int[arrayLength];
        cumulativeSum[0] = failureRates[0];
        for (int i = 1; i < arrayLength; i++) {
            cumulativeSum[i] = cumulativeSum[i - 1] + failureRates[i];
        }

        // 存储满足条件的时间段的开始和结束索引
        ArrayList<Integer[]> validPeriods = new ArrayList<>();
        int maxLength = 0;
        for (int start = 0; start < arrayLength; start++) {
            for (int end = start; end < arrayLength; end++) {
                int sum = start == 0 ? cumulativeSum[end] : cumulativeSum[end] - cumulativeSum[start - 1];
                int length = end - start + 1;
                int toleratedLoss = length * toleratedAverageLoss;

                // 如果这个时间段的平均失败率小于等于容忍的平均失败率
                if (sum <= toleratedLoss) {
                    // 如果这个时间段比之前找到的时间段更长，清空结果列表并添加这个时间段
                    if (length > maxLength) {
                        validPeriods = new ArrayList<>();
                        validPeriods.add(new Integer[]{start, end});
                        maxLength = length;
                    }
                    // 如果这个时间段和之前找到的最长时间段一样长，添加这个时间段
                    else if (length == maxLength) {
                        validPeriods.add(new Integer[]{start, end});
                    }
                }
            }
        }

        // 如果没有找到满足条件的时间段，输出"NULL"
        if (validPeriods.size() == 0) {
            System.out.println("NULL");
        }
        // 否则，输出所有满足条件的时间段
        else {
            validPeriods.sort((a, b) -> a[0] - b[0]);

            StringJoiner sj = new StringJoiner(" ");
            for (Integer[] period : validPeriods) sj.add(period[0] + "-" + period[1]);
            System.out.println(sj.toString());
        }
    }
}
